| Fully Qualified Name: | CodeIgniter\Test\Mock\MockSecurity |
| Extends: | Security |
| Name | Description | Defined By |
|---|---|---|
| CSRFSetCookie() | MockSecurity | |
| CSRFVerify() | CSRF Verify | Security |
| __construct() | Security constructor. | Security |
| getCSRFHash() | Returns the current CSRF Hash. | Security |
| getCSRFTokenName() | Returns the CSRF Token Name. | Security |
| sanitizeFilename() | Sanitize Filename | Security |
| Parameter Name | Type | Description |
|---|---|---|
| $request |
Returns: void
CSRF Verify
| Parameter Name | Type | Description |
|---|---|---|
| $request | \RequestInterface |
Returns: $this|bool
Security constructor.
Stores our configuration and fires off the init() method to setup initial state.
| Parameter Name | Type | Description |
|---|---|---|
| $config | \Config\App |
Returns:
Returns the current CSRF Hash.
Returns: string
Returns the CSRF Token Name.
Returns: string
Sanitize Filename
Tries to sanitize filenames in order to prevent directory traversal attempts and other security threats, which is particularly useful for files that were supplied via user input.
If it is acceptable for the user input to include relative paths, e.g. file/in/some/approved/folder.txt, you can set the second optional parameter, $relative_path to TRUE.
| Parameter Name | Type | Description |
|---|---|---|
| $str | string | Input |
| $relative_path | bool | Whether |
Returns: string